package mathive.client.panels;

import mathive.client.PanelHandler;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class ContactPanel {

	private VerticalPanel mainPanel = new VerticalPanel();
	private HTML title;
	private HTML info;
	private Button homeButton = new Button();
	
	public ContactPanel(){
		
		title = new HTML("<h1>Contact</h1>");
		info = new HTML("<p>Mathive Playground is a student project at<br>" +
				"Lule&aring; Tekniska Universtitet for the course Dynamic Web Systems.<br>" +
				"If you have any problems using this site please contact us<br>" +
				"and let us know. Sending en e-mail is a good idea.</p>");

		homeButton.setText("Back to Home");

		// Listen for mouse events on the home button.
		homeButton.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				PanelHandler.showHome();
			}
		});
	
	}
	
	public Widget getPanel(){
		initialize();
		return mainPanel;
	}
	
	private void initialize(){
		
		mainPanel.clear();
		
		mainPanel.add(title);
		mainPanel.add(info);
//		mainPanel.add(homeButton);
	}
}
